{% extends 'cms/cms_base.html' %}
{% block title %}
    评论管理
{% endblock %}
{% block page_title%}
    <h1>评论管理</h1>
{% endblock %}
{% block head %}

{% endblock %}
{% block page_content %}
    <table class="table table-bordered">
        <thead>
        <tr>
            <th>评论内容</th>
            <th>所属帖子</th>
            <th>评论者</th>
            <th>评论时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {% for comment in comments %}
            <tr>
                <td>{{ comment.content | safe }}</td>
                <td><a href="{{ url_for('front.pdetail',post_id = comment.post.id) }}">{{ comment.post.title }}</a></td>
                <td>{{ comment.author.username }}</td>
                <td>{{ comment.create_time }}</td>
                <td>
                    <button class="btn btn-danger btn-xs">删除</button>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
    <div style="text-align: center">
        {{ pagination1.links }}
    </div>
{% endblock %}